import { Controller, Post, UploadedFile } from '@nestjs/common';

import { Uploads } from 'src/dec/cu-dec/cu-dec.decorator';
import { fileTypeValidate } from 'src/utils/fileTypeValidata';

@Controller('uploads')
export class UploadsController {
  constructor() {}

  @Post('img')
  @Uploads('file', { fileFilter: fileTypeValidate('image') })
  uploadImg(@UploadedFile() fille: Express.Multer.File) {
    return fille;
  }
}
